<ion-view hide-tabs title="修改密码">
  <ion-nav-bar class="bar-energized light">
    <ion-nav-back-button>返回
    </ion-nav-back-button>
  </ion-nav-bar>
  <ion-content >
    <form name="editPasswordForm" ng-submit="submitEditPasswordForm('employer')">
      <div class="list">
        <label class="item item-input">
          <span class="input-label">旧密码：</span>
          <input type="password"
                 required
                 name="password"
                 ng-model="userData.password">
        </label>
        <div>
           <span ng-if="editPasswordForm.password.$error.required&&editPasswordForm.password.$touched">
              密码不能为空
            </span>
        </div>
        <label class="item item-input">
          <span class="input-label">新密码：</span>
          <input type="password"
                 name="password2"
                 ng-model="userData.password2"
                 required
                 ng-minlength="6"
                 ng-maxlength="12">
        </label>
        <div>
           <span ng-if="editPasswordForm.password2.$error.required&&editPasswordForm.password2.$touched">
              密码不能为空
            </span>
            <span ng-if="(editPasswordForm.password2.$error.minlength||editPasswordForm.password2.$error.maxlength)&&editPasswordForm.password2.$touched">
              密码6至12位之间
            </span>
        </div>

        <label class="item item-input">
          <span class="input-label">确认密码：</span>
          <input type="password"
                 ng-model="userData.password3"
                 required
                 name="password3"
                 compare="userData.password2"
                 >
        </label>
        <div>
          <span ng-if="editPasswordForm.password3.$error.compare&&editPasswordForm.password3.$touched">
            两次密码不一致
          </span>
        </div>

      </div>
      <div style="text-align: center;">
      <button class="button button-positive" type="submit" style="margin-top: 20px;width: 80%;" ng-disabled="">修改</button>
      </div>
    </form>
  </ion-content>
</ion-view>
